package xiangya.bysj.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import xiangya.bysj.entity.Medic;
import xiangya.bysj.mapper.interf.MedicMapper;
import xiangya.bysj.service.interf.MedicServiceInterface;

@Service("medicService")
public class MedicServiceImpl implements MedicServiceInterface {

	@Autowired
	private MedicMapper medicMapper;
	
	@Override
	public void save(Medic obj) throws Exception {
		medicMapper.save(obj);
	}

	@Override
	public void update(Medic obj) throws Exception {
		medicMapper.update(obj);
	}

	@Override
	public void delete(int objId) throws Exception {
		medicMapper.delete(objId);
	}

	@Override
	public int saveBach(List<Medic> list) throws Exception {
		return medicMapper.saveBatch(list);
	}

	@Override
	public List<Medic> getByName(String medicName) throws Exception {
		return medicMapper.selectByName(medicName);
	}

	@Override
	public Medic getById(int medicId) throws Exception {
		return medicMapper.selectById(medicId);
	}

}
